package com.woniu.map.service.impl;

import com.woniu.internalcommon.constant.CommonStatusEnum;
import com.woniu.internalcommon.dto.ResponseResult;
import com.woniu.map.remote.YingYanServiceClient;
import com.woniu.map.service.YingYanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class YingYanServiceImpl implements YingYanService {
    /**
     * 服务创建
     * @param name 服务名字
     * @return
     */
    @Autowired
    private YingYanServiceClient yingYanServiceClient;
    @Override
    public ResponseResult<String> createYingYanService(String name) {
        try {
            ;
            return ResponseResult.success(yingYanServiceClient.addYingYanService( name));
        }catch (Exception e){
            return ResponseResult.fail
                    (CommonStatusEnum.MAP_DISTRICT_ERROR.getCode(),"创建失败");

        }
    }
}
